package alp.starcode.nudtportal.framework.interceptor;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

/**
 * 配置拦截器
 *
 * @author hyc
 * @date 2022年6月22日15:27:16
 */
@Configuration
public class InterceptorConfig implements WebMvcConfigurer {

    @Resource
    private CertificationInterceptor certificationInterceptor;


    /**
     * 注意先后顺序
     *
     * @param registry 拦截器注册
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //小程序认证拦截器
        registry.addInterceptor(certificationInterceptor).addPathPatterns("/**/*.do").excludePathPatterns("/**/getLogoutUrl.do");
    }

}
